/**
 * 
 */
package com.taobao.wolfwolf.hibernate.service.impl;

import java.util.List;

import com.taobao.wolfwolf.hibernate.dao.ReceiverAddressDao;
import com.taobao.wolfwolf.hibernate.pojo.ReceiverAddress;
import com.taobao.wolfwolf.hibernate.service.ReceiverAddressService;

/**
 * @author Tux
 *
 * 创建时间: 2011-4-29 上午09:55:17
 */
public class ReceiverAddressServiceImpl extends BaseServiceImpl implements ReceiverAddressService {
	private ReceiverAddressDao rdao;
	
	public List<ReceiverAddress> findAll() {
		try {
			return getRdao().findAll();
		} catch(Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public ReceiverAddress findById(int id) {
		try {
			return getRdao().findById(id);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findById(int id)");
		}
		return null;
	}
	
	public List<ReceiverAddress> findByName(String name) {
		try {
			return getRdao().findByName(name);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findByName(String name)");
		}
		return null;
	}

	public long getTotal()  {
		try {
			return getRdao().getTotal();
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at getTotal()");
		}
		return -1;
	}

	public ReceiverAddressDao getRdao() {
		return rdao;
	}

	public void setRdao(ReceiverAddressDao rdao) {
		this.rdao = rdao;
	}
}
